<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Calculatrice polonais inversé LO21:  Fichier source de /home/yuntux/UTC/GI02/LO21/projet/projet_propre/rationnel.h</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Calculatrice polonais inversé LO21
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="namespaces.html"><span>Espaces&#160;de&#160;nommage</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/yuntux/UTC/GI02/LO21/projet/projet_propre/rationnel.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="rationnel_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef RATIONNEL_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define RATIONNEL_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="constante_8h.html" title="Calculatrice en polonais inversé. Classe composite de gestion des constantes.">constante.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="logmessage_8h.html">logmessage.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;exception&quot;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="comment">//Fonctions outils pour les simplifications de fractions : hors classe</span>
<a name="l00010"></a>00010 <span class="keywordtype">int</span> <a class="code" href="rationnel_8cpp.html#a7a18f1d2b66a88b6fce563c918d62198">pgcd</a>(<span class="keywordtype">int</span> a, <span class="keywordtype">int</span> b);
<a name="l00011"></a>00011 <span class="keywordtype">int</span> <a class="code" href="rationnel_8cpp.html#a27cab872c8e16edd012a1b1a4c707dc3">ppcm</a>(<span class="keywordtype">int</span> X,<span class="keywordtype">int</span> Y);
<a name="l00012"></a>00012 
<a name="l00013"></a><a class="code" href="class_rationnel.html">00013</a> <span class="keyword">class </span><a class="code" href="class_rationnel.html">Rationnel</a> : <span class="keyword">public</span> <a class="code" href="class_constante.html">Constante</a>{
<a name="l00014"></a>00014     <span class="keywordtype">int</span> _numerateur;
<a name="l00015"></a>00015     <span class="keywordtype">int</span> _denominateur;
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="keyword">public</span>:
<a name="l00018"></a>00018 
<a name="l00019"></a>00019     <span class="keyword">virtual</span> QString <a class="code" href="class_rationnel.html#aef5b4fb13f34b03cdf9132c272b5144f">afficher</a>() <span class="keyword">const</span>;
<a name="l00020"></a><a class="code" href="class_rationnel.html#a5802a9dda12b8af3ffef1eae3ee23d4a">00020</a>     <span class="keywordtype">float</span> <a class="code" href="class_rationnel.html#a5802a9dda12b8af3ffef1eae3ee23d4a">getNumerateur</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> _numerateur;}
<a name="l00021"></a><a class="code" href="class_rationnel.html#ae2a533befbdf1ec3977d36cd792af2ea">00021</a>     <span class="keywordtype">float</span> <a class="code" href="class_rationnel.html#ae2a533befbdf1ec3977d36cd792af2ea">getDenominateur</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> _denominateur;}
<a name="l00022"></a><a class="code" href="class_rationnel.html#ae96e448dcef2ceade17d42ddc58076bf">00022</a>     <span class="keywordtype">void</span> <a class="code" href="class_rationnel.html#ae96e448dcef2ceade17d42ddc58076bf">setNumerateur</a>(<span class="keywordtype">int</span> v){_numerateur=v; <a class="code" href="class_rationnel.html#a90d440a5d909748f5fda471e027e3a85">simplification</a>();}
<a name="l00023"></a><a class="code" href="class_rationnel.html#a09af735e39194e35ca2bfbaa6f8eb0b9">00023</a>     <span class="keywordtype">void</span> <a class="code" href="class_rationnel.html#a09af735e39194e35ca2bfbaa6f8eb0b9">setDenominateur</a>(<span class="keywordtype">int</span> v){
<a name="l00024"></a>00024         <span class="keywordflow">if</span> (v!=0) {
<a name="l00025"></a>00025             _denominateur=v;
<a name="l00026"></a>00026             <a class="code" href="class_rationnel.html#a90d440a5d909748f5fda471e027e3a85">simplification</a>();
<a name="l00027"></a>00027         } <span class="keywordflow">else</span> {
<a name="l00028"></a>00028             <span class="comment">//throw domain_error(&quot;Division par zéro&quot;);</span>
<a name="l00029"></a>00029             <span class="keywordflow">throw</span> <a class="code" href="class_log_message.html">LogMessage</a>(1,<span class="stringliteral">&quot;Division par zéro&quot;</span>, <a class="code" href="logmessage_8h.html#ac0565c81f330a720d673510e0886bb71ad1ddbfba3ebb4db9f8a7c5af53b23777">important</a>);
<a name="l00030"></a>00030         }
<a name="l00031"></a>00031     }
<a name="l00032"></a>00032     <a class="code" href="class_rationnel.html#a7e09e73d23a43aeb59086cabcd87381a">Rationnel</a>(<a class="code" href="class_constante.html">Constante</a>* c);
<a name="l00033"></a>00033     <a class="code" href="class_rationnel.html#a7e09e73d23a43aeb59086cabcd87381a">Rationnel</a>(<span class="keywordtype">int</span> num=0, <span class="keywordtype">int</span> den=1);
<a name="l00034"></a>00034     <span class="keywordtype">void</span> <a class="code" href="class_rationnel.html#a90d440a5d909748f5fda471e027e3a85">simplification</a>();
<a name="l00035"></a><a class="code" href="class_rationnel.html#a6710cf28d22bb53fda5474059877c2cd">00035</a>     <span class="keyword">virtual</span> <a class="code" href="class_rationnel.html#a6710cf28d22bb53fda5474059877c2cd">~Rationnel</a>() {}
<a name="l00036"></a>00036     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a4dc6b238834ace05451e69ea2bb6d02a">addition</a>(<a class="code" href="class_constante.html">Constante</a>* c);
<a name="l00037"></a>00037     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#aa1a21dae65f5fb48c56a376aea420bd6">produit</a>(<a class="code" href="class_constante.html">Constante</a> *c);
<a name="l00038"></a>00038     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#acf6c7167cfd8005ac723ce11feae2845">division</a>(<a class="code" href="class_constante.html">Constante</a>* c);
<a name="l00039"></a>00039     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a12ba8bcf6c200e85c4d260ee0bbb78b6">signe</a>();
<a name="l00040"></a>00040     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a268c0a861cdacea0593774b50a346a98">soustraction</a>(<a class="code" href="class_constante.html">Constante</a>* c);
<a name="l00041"></a>00041     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a45dd892e3366ff9be810fde32739b899">inv</a>();
<a name="l00042"></a>00042     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a68ab5e97a92bb2a08d667861eb920052">fact</a>();
<a name="l00043"></a>00043     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a5845bc3ef6eff4f427668fd3892e0f5f">sinus</a>(<span class="keywordtype">bool</span> angle);
<a name="l00044"></a>00044     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a2740232bc9f557bc4a896e2347312dc8">cosinus</a>(<span class="keywordtype">bool</span> angle);
<a name="l00045"></a>00045     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a48c54830a508d28a80d4b2be6762c9ae">sinush</a>(<span class="keywordtype">bool</span> angle);
<a name="l00046"></a>00046     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#af52bac0dacd387a802b08fa09e899e22">cosinush</a>(<span class="keywordtype">bool</span> angle);
<a name="l00047"></a>00047     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#af8e760a8cca5eea97ae2f7446074eb89">tangente</a>(<span class="keywordtype">bool</span> angle);
<a name="l00048"></a>00048     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#ac6f49836dd9d00e79965d247a4d9daee">tangenteh</a>(<span class="keywordtype">bool</span> angle);
<a name="l00049"></a>00049     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a5d671bc8d584725f11a130b91332400e">logN</a>();
<a name="l00050"></a>00050     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a93eea5c6c08ad840340743182231454f">log1</a>();
<a name="l00051"></a>00051     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#af437497d370b037d563a96fd6184b37f">puissance</a>(<a class="code" href="class_constante.html">Constante</a>* c);
<a name="l00052"></a>00052     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#aa191437241e88bb3a6f8953822489ac0">carre</a>();
<a name="l00053"></a>00053     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a48edd766bd572445e3bc31926e6c24e1">cube</a>();
<a name="l00054"></a>00054     <span class="keyword">virtual</span> <a class="code" href="class_constante.html">Constante</a>* <a class="code" href="class_rationnel.html#a3be00da71666a64e42dcf3737c5c153a">racine</a>();
<a name="l00055"></a>00055 };
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#endif // RATIONNEL_H</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Espaces de nommage</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Énumérations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Valeurs énumérées</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Généré le Samedi Juin 16 2012 23:51:37 pour Calculatrice polonais inversé LO21 par &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
